import pyautogui


def screen_shot_test():
    im1 = pyautogui.screenshot()  # 返回图片对象，但不写入磁盘
    print(im1)      # <PIL.Image.Image image mode=RGB size=1920x1080 at 0x1FA0B5C6A00>
    # im2 = pyautogui.screenshot('my_screenshot.png')  # 返回图片对象，同时写入磁盘
    # im3 = pyautogui.screenshot('my_screenshot_region.png', region=(0, 0, 300, 400))
    im4 = pyautogui.screenshot('my_screenshot_region1.png', region=(-1800, 0, 0, 880)) # 会报错，可能不能小于-1


def shot_return():
    button7location = pyautogui.locateCenterOnScreen('new.png', confidence=0.5)
    print(button7location)
    pyautogui.click(button7location)

def get_positon():
    pos = pyautogui.locateOnScreen('../choose.png', confidence=0.74, region=(0, 250, 214, 300))
    print(pos)

    pos = pyautogui.locateOnScreen('choose.png', confidence=0.74, region=(0, 256, 213, 296))
    print(pos)

get_positon()
